<!DOCTYPE html>
<div>1</div>
<div>
    <dialog id="test">
        <div>1</div>
    </dialog>
</div>
<div>2</div>
<script>
document.getElementById("test").showModal();
</script>